/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.systemadmin;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.talent.util.data.*;
import cn.javaxc.system.mapper.systemadmin.WorkFlowConfigMapper;
public class WorkFlowConfig extends BaseAction
{
    @Autowired(required=false)
	private WorkFlowConfigMapper mapper;
    /**
    工作流跳转
    */
    
    public Map workflowJump() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_step=mapper.s_step(params);
        result.put("s_step", s_step);
        
        
        SQLList<SQLMap> t_step=mapper.t_step(params);
        SQLMap t_step_emt=t_step.getExistfirst();
        result.put("t_step", t_step_emt);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        
        
        return result;
    }
    /**
    修改步骤
    */
    
    public Map upWorkStep() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_step=mapper.t_step(params);
        SQLMap t_step_emt=t_step.getExistfirst();
        result.put("t_step", t_step_emt);
        
        return result;
    }
    /**
    选择人员
    */
    
    public Map selectionStaff() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> person_info=mapper.person_info(params,pagination);
        person_info.setPagedListInfo(pagination);
        result.put("person_info", person_info);
        
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        tb = createTreeBean("l_firm_treecols");
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        return result;
    }
    /**
    工作流流程图
    */
    
    public Map workflowChart() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phases=mapper.phases(params);
        result.put("phases", phases);
        
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        Object plan_name =mapper.plan_name(params);
        result.put("plan_name", plan_name);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        
        
        return result;
    }
    /**
    工作流列表
    */
    
    public Map workflowList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_flow=mapper.s_flow(params);
        result.put("s_flow", s_flow);
        
        return result;
    }
    /**
    系统工作流
    */
    
    public Map systemWorkflow() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_hpage_step=mapper.s_hpage_step(params);
        result.put("s_hpage_step", s_hpage_step);
        
        return result;
    }
    /**
    修改人员
    */
    
    public Map upPerson() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_hpage_step=mapper.s_hpage_step(params);
        result.put("s_hpage_step", s_hpage_step);
        
        return result;
    }
    /**
    修改流程
    */
    
    public Map modifyWorkflow() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_plan=mapper.t_plan(params);
        SQLMap t_plan_emt=t_plan.getExistfirst();
        result.put("t_plan", t_plan_emt);
        
        return result;
    }
    /**
    */
    
    public Map d_step_skip() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_step_skip(params);
        
        return result;
    }
    /**
    修改步骤修改
    */
    
    public Map upWorkStepSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.upWorkStepSubmit(params);
        
        return result;
    }
    /**
    增加下一步修改
    */
    
    public Map addStepNext1Submit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMIDstep_id = mapper.CMIDstep_id(params);
        result.put("CMIDstep_id", CMIDstep_id);
        
        
        int i = mapper.i(params);
        result.put("i", i);
        
        return result;
    }
    /**
    工作流流程图修改
    */
    
    public Map workflowChartSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        TreeTableHelper.parseFlowJson(context,request.getParameter("pathInfo"));
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.workflowChartSubmit(params);
        }
        
        return result;
    }
    /**
    */
    
    public Map reset() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.reset(params);
        
        return result;
    }
    /**
    增加开始步骤修改
    */
    
    public Map addStartNextSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMIDstep_id = mapper.CMIDstep_id(params);
        result.put("CMIDstep_id", CMIDstep_id);
        
        
        mapper.addStartNextSubmit(params);
        
        return result;
    }
    /**
    */
    
    public Map dis_plan() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.dis_plan(params);
        
        return result;
    }
    /**
    */
    
    public Map ena_plan() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.ena_plan(params);
        
        return result;
    }
    /**
    */
    
    public Map d_plan() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_plan(params);
        
        return result;
    }
    /**
    修改人员修改
    */
    
    public Map upPersonSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.upPersonSubmit(params);
        }
        
        return result;
    }
    /**
    增加流程修改
    */
    
    public Map addflowManaSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMIDplan_id = mapper.CMIDplan_id(params);
        result.put("CMIDplan_id", CMIDplan_id);
        
        
        int CMIDphase_id = mapper.CMIDphase_id(params);
        result.put("CMIDphase_id", CMIDphase_id);
        
        
        int CMIDstep_id = mapper.CMIDstep_id(params);
        result.put("CMIDstep_id", CMIDstep_id);
        
        return result;
    }
    /**
    修改流程修改
    */
    
    public Map modifyWorkflowSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.modifyWorkflowSubmit(params);
        
        return result;
    }
}